package com.manage.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class SystemUtil {

	static Properties prop = new Properties();

	static {
		try {
			InputStream in = SystemUtil.class.getResourceAsStream("/resources/app.properties");
			prop.load(in);
			in.close();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	public static boolean isDebug() {
		return prop.getProperty("app_filter").equals("false");
	}

	public static boolean isJmsEnable() {
		return !prop.getProperty("jms_enable").equals("false");
	}

	public static boolean isRedisEnable() {
		return !prop.getProperty("redis_enable").equals("false");
	}

	public static boolean isMongoEnable() {
		return !prop.getProperty("mongo_enable").equals("false");
	}

	public static String getAppProp(String string) {
		return prop.getProperty("image_context", "");
	}

	public static String getProp(String string) {
		return prop.getProperty(string, "");
	}

	public static String getProp(String string, String def) {
		return prop.getProperty(string, def);
	}
}
